<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		if(${sessionScope.mvo==null }){
			alert("회원으로 로그인 하세요~!");
			location.href="wedding.do?command=loginForm";
		}else{
		$("#write").click(function(){
			var qnaTitle = $("#qnaTitle").val();
			var qnaPassword = $("#qnaPassword").val();
			var qnaContent = $("#qnaContent").val();
			
			if(qnaTitle == ""){
				alert("글제목을 입력하세요");
				return false;
			}
			else if(qnaPassword == ""){
				alert("비밀번호를 입력하세요");
				return false;
			}
			else if(qnaContent == ""){
				alert("내용을 입력하세요");
				return false;
			}
			$("#write_form").submit();
		});
		$("#list").click(function() {
			location.href="qna.do?command=qnaAllBoardList";
		})
		}
	});
	
</script>


<br>

<form action="qna.do" method="post" name="write_form" id="write_form">
	<input type="hidden" id="command" name="command" value="qnaWrite">
	<%--     <input type="hidden" id="id" name="id" value="${sessionScope.mvo.id }"> --%>
	<table width="700" align="center" style="border-style:dotted; border-color:gray;">
	<tr>
		<td></td>
	</tr>
	
		<tr>
			<td align="left"><font size="2"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			제목 : </b></font><input type="text" id="qnaTitle" name="qnaTitle"
				maxlength="100" size="50"></td>
		</tr>
		<tr>
			<td align="right"><font size="2"><b>비밀번호 : </b></font><input type="password" id="qnaPassword"
				name="qnaPassword" maxlength="50" size="15">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
		<tr>
			<td align="center"><textarea cols="70" rows="10" id="qnaContent"
					name="qnaContent"></textarea></td>
		</tr>
	</table><br>
	<table align="center" width="700">
		<tr>
			<td align="center"><img src="${initParam.root }/img/confirm_button.gif" id="write">
			<img src="${initParam.root }/img/list_btn.gif" id="list"></td>

		</tr>
	</table>
</form>